﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LSEntity
{
    public class WebPageConfig
    {
        public string LocalName { get; set; }
        public string Area { get; set; }
        public string ViewPath
        {
            get
            {
                return String.IsNullOrEmpty(Area)
                           ? "~/Views/" + LocalName + "/"
                           : "~/Areas/" + Area + "/Views/Temp/" + LocalName + "/";
            }
        }

        public string GetUrl(string fileName = null)
        {
            return String.Format("/{0}/{1}", Area, String.IsNullOrEmpty(fileName) ? String.Empty : fileName);
        }
    }

    public class LoginConfig : WebPageConfig
    {
        public LoginConfig()
        {
            IsAsyn = true;
        }

        public string UserName { get; set; }
        public string UserPass { get; set; }
        public bool IsRemember { get; set; }
        public virtual string ReturnUrl { get; set; }
        public bool IsAsyn { get; set; }
    }
}
